﻿using System;

namespace CNav.Common
{
    public static class Argument
    {
        public static void IsNotNull(string argname, object value)
        {
           if(value == null)
               throw new ArgumentException(argname);
        }

        public static void IsNotSet(string argname, int value)
        {
            if (value == 0)
                throw new ArgumentException(argname);
        }

        public static void IsNotSet(string argname, double value)
        {
            if (value == 0)
                throw new ArgumentException(argname);
        }

        public static void IsNotSet(string argname, float value)
        {
            if (value == 0)
                throw new ArgumentException(argname);
        }

        public static void IsNotSet(string argname, decimal value)
        {
            if (value == 0)
                throw new ArgumentException(argname);
        }
    }
}